import request from '@/utils/hcemRequest'

// 查询问卷模板管理列表
export function listTitle(query) {
  return request({
    url: '/hcem/title/list',
    method: 'get',
    params: query
  })
}

// 查询问卷模板管理详细
export function getTitle(id) {
  return request({
    url: '/hcem/title/' + id,
    method: 'get'
  })
}

// 新增问卷模板管理
export function addTitle(data) {
  return request({
    url: '/hcem/title',
    method: 'post',
    data: data
  })
}

// 修改问卷模板管理
export function updateTitle(data) {
  return request({
    url: '/hcem/title',
    method: 'put',
    data: data
  })
}

// 删除问卷模板管理
export function delTitle(id) {
  return request({
    url: '/hcem/title/' + id,
    method: 'delete'
  })
}


export function linkDic() {  //类型字典
  return request({
    url: '/system/dict/data/type/link_type',
    method: 'get'
  })
}

export function getModal(id) {  //类型字典
  return request({
    url: `hcem/title/${id}`,
    method: 'get'
  })
}

export function addModal(data) {  //添加模板
  return request({
    url: '/hcem/title',
    method: 'post',
    data: data
  })
}

export function putModal(data) {
  //修改模板
  return request({
    url: `/hcem/title`,
    method: 'put',
    data: data
  })
}


export function hosList() {  //医院列表
  return request({
    url: `/hcem/hospital/pullDownHosp`,
    method: 'get',
  })
}



export function dajuanDetails(id) {  //答卷回显
  return request({
    url: `/hcem/content/getAnswerInfo/${id}`,
    method: 'get',
  })
}

export function sourceList(hospCode) {  //获取来源下拉数据
  return request({
    url: `/hcem/source/pullDownSource?hospCode=${hospCode}`,
    method: 'get',
  })
}

export function TitleList(hospCode) {  //模板下拉列表
  return request({
    url: `/hcem/title/pullDownTitle?hospCode=${hospCode}`,
    method: 'get',
  })
}



export function copyTemplate(query) {
  return request({
    url: '/hcem/title/copyTemplate',
    method: 'post',
    params: query
  })
}
//添加模板选项
export function addxuanti(query) {
  return request({
    url: '/hcem/template/addQuestion',
    method: 'post',
    params: query
  })
}
//编辑模板标题
export function edittemTitapi(query) {
  return request({
    url: '/hcem/template/edit',
    method: 'post',
    params: query
  })
}
//删除问题或选项

export function delprooroption(query) {
  return request({
    url: '/hcem/template/delQuestion',
    method: 'post',
    params: query
  })
}
//新增逻辑关系
export function addluoji(query) {
  return request({
    url: '/hcem/template/addLogic',
    method: 'post',
    params: query
  })
}
export function editluoji(query) {
  return request({
    url: '/hcem/template/addLogic',
    method: 'post',
    params: query
  })
}
//获取问题逻辑
export function wentiluoji(query) {
  return request({
    url: '/hcem/template/getLogic',
    method: 'get',
    params: query
  })
}
//获取模板详情
export function getmobandetail(query) {
  return request({
    url: '/hcem/template/getTemplate',
    method: 'get',
    params: query
  })
}
//编辑某项问题
export function editWenti(data) {
  return request({
    url: '/hcem/template/editQuestion',
    method: 'post',
    data
  })
}
//删除逻辑
export function delluoji(query) {
  return request({
    url: '/hcem/template/delLogic',
    method: 'post',
    params: query
  })
}
//发布接口
export function fabumoban(query) {
  return request({
    url: '/hcem/template/publish',
    method: 'post',
    params: query
  })
}





//echarts
//四方格统计
export function dataStatisticsOne(query) {
  return request({
    url: '/hcem/statistics/dataStatisticsOne',
    method: 'get',
    params: query
  })
}

export function indexCharts(query) {
  return request({
    url: '/hcem/statistics/deptCompare',
    method: 'get',
    params: query
  })
}


//满意度圆形图和波浪图
export function dataStatisticsTwo(query) {
  return request({
    url: '/hcem/statistics/dataStatisticsTwo',
    method: 'get',
    params: query
  })
}

//来源占比圆形图和问卷提交波浪图
export function dataStatisticsThree(query) {
  return request({
    url: '/hcem/statistics/dataStatisticsThree',
    method: 'get',
    params: query
  })
}

//问题满意度柱状图
export function dataStatisticsFour(query) {
  return request({
    url: '/hcem/statistics/dataStatisticsFour',
    method: 'get',
    params: query
  })
}
//问题满意度柱状图
export function dataStatisticsFive(query) {
  return request({
    url: '/hcem/statistics/dataStatisticsFive',
    method: 'get',
    params: query
  })
}

export function listData(query) {
  return request({
    url: '/system/dict/data/list',
    method: 'get',
    params: query
  })
}

// export function indexCharts(query) {
//   return request({
//     url: '/hcem/statistics/deptCompare',
//     method: 'get',
//     params: query
//   })
// }




// export const linkDic = function (json) {
//   return Vue.prototype.$get(myBaseUrl('system/dict/data/type/link_type'), json)
// }
// export const addModal = function (json) {
//   return Vue.prototype.$post(myBaseUrl('hcem/title'), json)
// }
// export const putModal = function (json) {
//   return Vue.prototype.$put(myBaseUrl('hcem/title'), json)
// }
// export const getModal = function (id) {  //修改前的回显
//   return Vue.prototype.$get(myBaseUrl(`hcem/title/${id}`))
// }

// export const delModal = function (id) {  //修改前的回显
//   return Vue.prototype.$del(myBaseUrl(`hcem/title/${id}`))
// }

// export const hosList = function (json) {
//   return Vue.prototype.$get(myBaseUrl('hcem/hospital/pullDownHosp'), json)
// }
// export const getMoalList = function (json) {
//   return Vue.prototype.$get(myBaseUrl('hcem/title/list'), json)
// }